/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.st.entity;

import com.jeesite.common.mybatis.annotation.JoinTable;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 送货通知Entity
 * @author HOHD
 * @version 2020-12-19
 */
@Table(name="st_send_notice_bill_detail", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="material_name", attrName="materialName", label="物料", queryType=QueryType.LIKE),
		@Column(name="number", attrName="number", label="数量"),
		@Column(name="unit", attrName="unit", label="单位"),
		@Column(name="remarks", attrName="remarks", label="备注", queryType=QueryType.LIKE),
		@Column(name="parent_id", attrName="parentId.id", label="父 id"),
		@Column(name="primary_id", attrName="primaryId", label="父 id"),
	}, orderBy="a.id ASC",
		joinTable = {
		@JoinTable(type = JoinTable.Type.LEFT_JOIN,on="p.id=a.material_name",entity = StProductRecord.class,alias = "p",attrName = "stProductRecord"),
}
)
public class StSendNoticeBillDetail extends DataEntity<StSendNoticeBillDetail> {
	
	private static final long serialVersionUID = 1L;
	private String materialName;		// 物料
	private Integer number;		// 数量
	private String unit;		// 单位
	private StSendNoticeBill parentId;		// 父 id 父类
	private StProductRecord stProductRecord;
	private String primaryId;

	public String getPrimaryId() {
		return primaryId;
	}

	public void setPrimaryId(String primaryId) {
		this.primaryId = primaryId;
	}

	public StSendNoticeBillDetail() {
		this(null);
	}


	public StSendNoticeBillDetail(StSendNoticeBill parentId){
		this.parentId = parentId;
	}

	public StProductRecord getStProductRecord() {
		return stProductRecord;
	}

	public void setStProductRecord(StProductRecord stProductRecord) {
		this.stProductRecord = stProductRecord;
	}

	@Length(min=0, max=36, message="物料长度不能超过 36 个字符")
	public String getMaterialName() {
		return materialName;
	}

	public void setMaterialName(String materialName) {
		this.materialName = materialName;
	}

	public void idIn(String[] pidArr) {
		sqlMap.getWhere().and("parent_id", QueryType.IN, pidArr);
	}
	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}
	
	@Length(min=0, max=36, message="单位长度不能超过 36 个字符")
	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}
	
	@Length(min=0, max=36, message="父 id长度不能超过 36 个字符")
	public StSendNoticeBill getParentId() {
		return parentId;
	}

	public void setParentId(StSendNoticeBill parentId) {
		this.parentId = parentId;
	}
	
}